# 文件的穿件需要使用函数open（）来实现
open('新建文本文档.txt', 'r', encoding='utf-8')
print(f.read)
# 使用with open读取文件
with open('新建文本文档.txt', 'r', encoding='utf-8') as file
    text = file.read()
print(text)

# 写文件write()
data = 'hello world'
f1 = open('333.txt','w', encoding='utf-8' )
f1.write('hello,hello')
f1.close()

# 打开文件用于写入，如果文件不存在将会被创建
with open('333.tet', 'a', encoding='utf-8') as file:
    file.write(data)